#ifndef OSGDATAMANAGER_H
#define OSGDATAMANAGER_H

#include <QObject>
#include <QSharedPointer>
#include <QGlobalStatic>
#include <QMap>

#include "modelnode.h"
#include "basenode.h"
#include "slicenode.h"

#define OSGDATAMANAGER HIM::OsgDataManager::instance()

namespace HIM {
class OsgDataManager : public QObject
{
public:    
    Q_OBJECT
public:
    OsgDataManager(){};
    virtual ~OsgDataManager(){};

    static OsgDataManager* instance();
    void init();
    void loadConfigData();

    void createBaseNode(QString name);
    void createModelNode(QString name,osg::Node * model);
    void createSliceNode(QString name);

    BaseNode* getBaseNode(QString name);
    SliceNode* getSliceNode(QString name);
    ModelNode* getModelNode(QString name);


private:
    QVector<QString> nodeVector;
    QMap<QString,QSharedPointer<BaseNode>> baseNodeMap;
    QMap<QString,QSharedPointer<SliceNode>> sliceNodeMap;
    QMap<QString,QSharedPointer<ModelNode>> modelNodeMap;
};
}

#endif
